cd "$replication\code\"

set matsize 5000

****************************************************************************** Input variables ************************************************************
global cluster "sd_code"
global AS_infs `""""'
global AS_var "NA"
global sample "year!=."
global controls ""
global controlsXYFEs ""
global controlsXinfs ""
global omitted_year1=-1
global omitted_year2=-6
global min_year=-6
global max_year=5
global colour="no_graphs"
global depvar "icw_irrigation"

global int "elecXroad"
local inf1=substr("${int}",1,4)
local inf2=substr("${int}",6,.)
global  infs "`inf1' `inf2' ${int}"
global absorb "shrid_code i.s_code#i.year"
global depvar "icw_irrigation"


***** Column 1
global title "Received programs \\ in same year"
global sample "elec_first==0 & road_first==0" 
global int "elecXroad"
global infs "elecXroad"
qui : do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}


***** Column 2
global title "Received \\ electricity first"
global sample "elec_first==1"
global int "elecXroad"
global infs "elec elecXroad"
qui : do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}


***** Column 3
global title "Received \\ road first"
global sample "road_first==1"
global int "elecXroad"
global infs "road elecXroad"
global sample "year!=."
qui : do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}


